package day2001;

import java.lang.reflect.Constructor;
import java.util.Collections;

public class chuangjianduixiang {
    public static void main(String[] args) throws Exception {
        Class a = anli.class;
        Constructor b = a.getConstructor(int.class,String.class,int.class);
        b.newInstance(10,"20",30);

        Class aa = anli.class;
        Constructor bb = aa.getDeclaredConstructor(String.class,int.class,int.class);//反射暴力执行带参数私有构造方法
        bb.setAccessible(true);
        bb.newInstance("zhangsan",10,30);

        Class aaa = anli.class;
        Constructor bbb = aaa.getDeclaredConstructor();//反射暴力执行无参数私有构造方法
        bbb.setAccessible(true);
        bbb.newInstance();
    }
}
